#!/bin/sh

set_gpio()
{
    if [ ! -d "/sys/class/gpio/GPIO$1" ]; then
        echo $1 > /sys/class/gpio/export
        echo out > /sys/class/gpio/GPIO$1/direction
    fi

    echo $2 > /sys/class/gpio/GPIO$1/value
}

cd /lib/modules/4.9.129/fullhan

# mmz:name,0,start,size,type
insmod vmm.ko mmz=anonymous,0,0xA2000000,32M anony=1
#insmod vmm.ko mmz=anonymous,0,0xA1F00000,33M anony=1
#insmod vmm.ko mmz=anonymous,0,0xA1B00000,37M anony=1 # 4MP
#insmod vmm.ko mmz=anonymous,0,0xA4000000,64M anony=1 # 5MP
#insmod vmm.ko mmz=anonymous,0,0xA2400000,90M anony=1 # 8MP

#reset sensor
set_gpio 13 0

insmod xbus_rpc.ko fn=/lib/firmware/rtthread_arc_FH885xV200.bin fa=0xbff80000

#unreset sensor
set_gpio 13 1

insmod media_process.ko
insmod isp.ko
insmod vpu.ko #vpu_mode=buf_0_2,buf_1_2
insmod enc.ko
insmod jpeg.ko
#insmod bgm.ko